#ifndef _GL_ALL_H
#define _GL_ALL_H

#ifdef WIN32
#include <windows.h>                                            // Including The Windows Header
#endif
#include <GL/gl.h>												// Including The OpenGL Header
#include <GL/glext.h>											// Including OpenGL Extensions
#include "gladd.h"												// Including Extensions that are commonly not found (when GL headers are not up to date)

#ifndef WIN32
#define FORCE_ARB1_PROTOTYPES
#ifdef GL_VERSION_1_4
#define FORCE_ARB2_PROTOTYPES
#define FORCE_ARB3_PROTOTYPES
#define FORCE_EXT1_PROTOTYPES
#define FORCE_NV1_PROTOTYPES
#endif
#endif

extern  int rt_ARB_multitexture;
#if defined(GL_ARB_multitexture)
extern  GLint num_texture_units;
#if !defined(GL_GLEXT_PROTOTYPES) && !defined(FORCE_ARB1_PROTOTYPES)
extern  PFNGLACTIVETEXTUREARBPROC       glActiveTextureARB;
extern  PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB;
extern  PFNGLMULTITEXCOORD1DARBPROC     glMultiTexCoord1dARB;
extern  PFNGLMULTITEXCOORD1DVARBPROC    glMultiTexCoord1dvARB;
extern  PFNGLMULTITEXCOORD1FARBPROC     glMultiTexCoord1fARB;
extern  PFNGLMULTITEXCOORD1FVARBPROC    glMultiTexCoord1fvARB;
extern  PFNGLMULTITEXCOORD1IARBPROC     glMultiTexCoord1iARB;
extern  PFNGLMULTITEXCOORD1IVARBPROC    glMultiTexCoord1ivARB;
extern  PFNGLMULTITEXCOORD1SARBPROC     glMultiTexCoord1sARB;
extern  PFNGLMULTITEXCOORD1SVARBPROC    glMultiTexCoord1svARB;
extern  PFNGLMULTITEXCOORD2DARBPROC     glMultiTexCoord2dARB;
extern  PFNGLMULTITEXCOORD2DVARBPROC    glMultiTexCoord2dvARB;
extern  PFNGLMULTITEXCOORD2FARBPROC     glMultiTexCoord2fARB;
extern  PFNGLMULTITEXCOORD2FVARBPROC    glMultiTexCoord2fvARB;
extern  PFNGLMULTITEXCOORD2IARBPROC     glMultiTexCoord2iARB;
extern  PFNGLMULTITEXCOORD2IVARBPROC    glMultiTexCoord2ivARB;
extern  PFNGLMULTITEXCOORD2SARBPROC     glMultiTexCoord2sARB;
extern  PFNGLMULTITEXCOORD2SVARBPROC    glMultiTexCoord2svARB;
extern  PFNGLMULTITEXCOORD3DARBPROC     glMultiTexCoord3dARB;
extern  PFNGLMULTITEXCOORD3DVARBPROC    glMultiTexCoord3dvARB;
extern  PFNGLMULTITEXCOORD3FARBPROC     glMultiTexCoord3fARB;
extern  PFNGLMULTITEXCOORD3FVARBPROC    glMultiTexCoord3fvARB;
extern  PFNGLMULTITEXCOORD3IARBPROC     glMultiTexCoord3iARB;
extern  PFNGLMULTITEXCOORD3IVARBPROC    glMultiTexCoord3ivARB;
extern  PFNGLMULTITEXCOORD3SARBPROC     glMultiTexCoord3sARB;
extern  PFNGLMULTITEXCOORD3SVARBPROC    glMultiTexCoord3svARB;
extern  PFNGLMULTITEXCOORD4DARBPROC     glMultiTexCoord4dARB;
extern  PFNGLMULTITEXCOORD4DVARBPROC    glMultiTexCoord4dvARB;
extern  PFNGLMULTITEXCOORD4FARBPROC     glMultiTexCoord4fARB;
extern  PFNGLMULTITEXCOORD4FVARBPROC    glMultiTexCoord4fvARB;
extern  PFNGLMULTITEXCOORD4IARBPROC     glMultiTexCoord4iARB;
extern  PFNGLMULTITEXCOORD4IVARBPROC    glMultiTexCoord4ivARB;
extern  PFNGLMULTITEXCOORD4SARBPROC     glMultiTexCoord4sARB;
extern  PFNGLMULTITEXCOORD4SVARBPROC    glMultiTexCoord4svARB;
#endif
#endif

extern  int rt_ARB_texture_cube_map;
#if defined(GL_ARB_texture_cube_map) && !defined(GL_GLEXT_PROTOTYPES) && !defined(FORCE_ARB2_PROTOTYPES)
#endif

extern  int rt_ARB_texture_env_add;
#if defined(GL_ARB_texture_env_add) && !defined(GL_GLEXT_PROTOTYPES) && !defined(FORCE_ARB2_PROTOTYPES)
#endif

extern  int rt_ARB_texture_env_dot3;
#if defined(GL_ARB_texture_env_dot3) && !defined(GL_GLEXT_PROTOTYPES) && !defined(FORCE_ARB2_PROTOTYPES)
#endif

extern  int rt_ARB_texture_env_combine;
#if defined(GL_ARB_texture_env_combine) && !defined(GL_GLEXT_PROTOTYPES) && !defined(FORCE_ARB2_PROTOTYPES)
#endif

extern  int rt_ARB_texture_env_crossbar;
#if defined(GL_ARB_texture_env_crossbar) && !defined(GL_GLEXT_PROTOTYPES) && !defined(FORCE_ARB2_PROTOTYPES)
#endif

extern  int rt_EXT_bgra;
#if defined(GL_EXT_bgra) && !defined(GL_GLEXT_PROTOTYPES) && !defined(FORCE_EXT1_PROTOTYPES)
#endif

extern  int rt_NV_texture_env_combine4;
#if defined(GL_NV_texture_env_combine4) && !defined(GL_GLEXT_PROTOTYPES) && !defined(FORCE_NV1_PROTOTYPES)
#endif

extern  int rt_NV_register_combiners;
#if defined(GL_NV_register_combiners)
extern  GLint num_general_combiners;
#if !defined(GL_GLEXT_PROTOTYPES) && !defined(FORCE_NV1_PROTOTYPES)
extern  PFNGLCOMBINERPARAMETERFVNVPROC              glCombinerParameterfvNV;
extern  PFNGLCOMBINERPARAMETERFNVPROC               glCombinerParameterfNV;
extern  PFNGLCOMBINERPARAMETERIVNVPROC              glCombinerParameterivNV;
extern  PFNGLCOMBINERPARAMETERINVPROC               glCombinerParameteriNV;
extern  PFNGLCOMBINERINPUTNVPROC                    glCombinerInputNV;
extern  PFNGLCOMBINEROUTPUTNVPROC                   glCombinerOutputNV;
extern  PFNGLFINALCOMBINERINPUTNVPROC               glFinalCombinerInputNV;
extern  PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC      glGetCombinerInputParameterfvNV;
extern  PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC      glGetCombinerInputParameterivNV;
extern  PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC     glGetCombinerOutputParameterfvNV;
extern  PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC     glGetCombinerOutputParameterivNV;
extern  PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC glGetFinalCombinerInputParameterfvNV;
extern  PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC glGetFinalCombinerInputParameterivNV;
#endif
#endif

extern  int rt_ATI_fragment_shader;
#if defined(GL_ATI_fragment_shader) && !defined(GL_GLEXT_PROTOTYPES) && !defined(FORCE_ATI1_PROTOTYPES)
extern  PFNGLGENFRAGMENTSHADERSATIPROC          glGenFragmentShadersATI;
extern  PFNGLBINDFRAGMENTSHADERATIPROC          glBindFragmentShaderATI;
extern  PFNGLDELETEFRAGMENTSHADERATIPROC        glDeleteFragmentShaderATI;
extern  PFNGLBEGINFRAGMENTSHADERATIPROC         glBeginFragmentShaderATI;
extern  PFNGLENDFRAGMENTSHADERATIPROC           glEndFragmentShaderATI;
extern  PFNGLPASSTEXCOORDATIPROC                glPassTexCoordATI;
extern  PFNGLSAMPLEMAPATIPROC                   glSampleMapATI;
extern  PFNGLCOLORFRAGMENTOP1ATIPROC            glColorFragmentOp1ATI;
extern  PFNGLCOLORFRAGMENTOP2ATIPROC            glColorFragmentOp2ATI;
extern  PFNGLCOLORFRAGMENTOP3ATIPROC            glColorFragmentOp3ATI;
extern  PFNGLALPHAFRAGMENTOP1ATIPROC            glAlphaFragmentOp1ATI;
extern  PFNGLALPHAFRAGMENTOP2ATIPROC            glAlphaFragmentOp2ATI;
extern  PFNGLALPHAFRAGMENTOP3ATIPROC            glAlphaFragmentOp3ATI;
extern  PFNGLSETFRAGMENTSHADERCONSTANTATIPROC   glSetFragmentShaderConstantATI;
#endif

extern  int rt_ARB_vertex_buffer_object;
#if defined(GL_ARB_vertex_buffer_object) && !defined(GL_GLEXT_PROTOTYPES) && !defined(FORCE_ARB3_PROTOTYPES)
extern  PFNGLBINDBUFFERARBPROC              glBindBufferARB;
extern  PFNGLDELETEBUFFERSARBPROC           glDeleteBuffersARB;
extern  PFNGLGENBUFFERSARBPROC              glGenBuffersARB;
extern  PFNGLISBUFFERARBPROC                glIsBufferARB;
extern  PFNGLBUFFERDATAARBPROC              glBufferDataARB;
extern  PFNGLBUFFERSUBDATAARBPROC           glBufferSubDataARB;
extern  PFNGLGETBUFFERSUBDATAARBPROC        glGetBufferSubDataARB;
extern  PFNGLMAPBUFFERARBPROC               glMapBufferARB;
extern  PFNGLUNMAPBUFFERARBPROC             glUnmapBufferARB;
extern  PFNGLGETBUFFERPARAMETERIVARBPROC    glGetBufferParameterivARB;
extern  PFNGLGETBUFFERPOINTERVARBPROC       glGetBufferPointervARB;
#endif

extern  int rt_ARB_vertex_program;
#if defined(GL_ARB_vertex_program) && !defined(GL_GLEXT_PROTOTYPES) && !defined(FORCE_ARB3_PROTOTYPES)
extern  PFNGLVERTEXATTRIB1SARBPROC				glVertexAttrib1sARB;
extern  PFNGLVERTEXATTRIB1FARBPROC				glVertexAttrib1fARB;
extern  PFNGLVERTEXATTRIB1DARBPROC				glVertexAttrib1dARB;
extern  PFNGLVERTEXATTRIB2SARBPROC				glVertexAttrib2sARB;
extern  PFNGLVERTEXATTRIB2FARBPROC				glVertexAttrib2fARB;
extern  PFNGLVERTEXATTRIB2DARBPROC				glVertexAttrib2dARB;
extern  PFNGLVERTEXATTRIB3SARBPROC				glVertexAttrib3sARB;
extern  PFNGLVERTEXATTRIB3FARBPROC				glVertexAttrib3fARB;
extern  PFNGLVERTEXATTRIB3DARBPROC				glVertexAttrib3dARB;
extern  PFNGLVERTEXATTRIB4SARBPROC				glVertexAttrib4sARB;
extern  PFNGLVERTEXATTRIB4FARBPROC				glVertexAttrib4fARB;
extern  PFNGLVERTEXATTRIB4DARBPROC				glVertexAttrib4dARB;
extern  PFNGLVERTEXATTRIB4NUBARBPROC			glVertexAttrib4NubARB;
extern  PFNGLVERTEXATTRIB1SVARBPROC				glVertexAttrib1svARB;
extern  PFNGLVERTEXATTRIB1FVARBPROC				glVertexAttrib1fvARB;
extern  PFNGLVERTEXATTRIB1DVARBPROC				glVertexAttrib1dvARB;
extern  PFNGLVERTEXATTRIB2SVARBPROC				glVertexAttrib2svARB;
extern  PFNGLVERTEXATTRIB2FVARBPROC				glVertexAttrib2fvARB;
extern  PFNGLVERTEXATTRIB2DVARBPROC				glVertexAttrib2dvARB;
extern  PFNGLVERTEXATTRIB3SVARBPROC				glVertexAttrib3svARB;
extern  PFNGLVERTEXATTRIB3FVARBPROC				glVertexAttrib3fvARB;
extern  PFNGLVERTEXATTRIB3DVARBPROC				glVertexAttrib3dvARB;
extern  PFNGLVERTEXATTRIB4BVARBPROC				glVertexAttrib4bvARB;
extern  PFNGLVERTEXATTRIB4SVARBPROC				glVertexAttrib4svARB;
extern  PFNGLVERTEXATTRIB4IVARBPROC				glVertexAttrib4ivARB;
extern  PFNGLVERTEXATTRIB4UBVARBPROC			glVertexAttrib4ubvARB;
extern  PFNGLVERTEXATTRIB4USVARBPROC			glVertexAttrib4usvARB;
extern  PFNGLVERTEXATTRIB4UIVARBPROC			glVertexAttrib4uivARB;
extern  PFNGLVERTEXATTRIB4FVARBPROC				glVertexAttrib4fvARB;
extern  PFNGLVERTEXATTRIB4DVARBPROC				glVertexAttrib4dvARB;
extern  PFNGLVERTEXATTRIB4NBVARBPROC			glVertexAttrib4NbvARB;
extern  PFNGLVERTEXATTRIB4NSVARBPROC			glVertexAttrib4NsvARB;
extern  PFNGLVERTEXATTRIB4NIVARBPROC			glVertexAttrib4NivARB;
extern  PFNGLVERTEXATTRIB4NUBVARBPROC			glVertexAttrib4NubvARB;
extern  PFNGLVERTEXATTRIB4NUSVARBPROC			glVertexAttrib4NusvARB;
extern  PFNGLVERTEXATTRIB4NUIVARBPROC			glVertexAttrib4NuivARB;
extern  PFNGLVERTEXATTRIBPOINTERARBPROC			glVertexAttribPointerARB;
extern  PFNGLENABLEVERTEXATTRIBARRAYARBPROC		glEnableVertexAttribArrayARB;
extern  PFNGLDISABLEVERTEXATTRIBARRAYARBPROC	glDisableVertexAttribArrayARB;
extern  PFNGLPROGRAMSTRINGARBPROC				glProgramStringARB;
extern  PFNGLBINDPROGRAMARBPROC					glBindProgramARB;
extern  PFNGLDELETEPROGRAMSARBPROC				glDeleteProgramsARB;
extern  PFNGLGENPROGRAMSARBPROC					glGenProgramsARB;
extern  PFNGLPROGRAMENVPARAMETER4FARBPROC		glProgramEnvParameter4fARB;
extern  PFNGLPROGRAMENVPARAMETER4DARBPROC		glProgramEnvParameter4dARB;
extern  PFNGLPROGRAMENVPARAMETER4FVARBPROC		glProgramEnvParameter4fvARB;
extern  PFNGLPROGRAMENVPARAMETER4DVARBPROC		glProgramEnvParameter4dvARB;
extern  PFNGLPROGRAMLOCALPARAMETER4FARBPROC		glProgramLocalParameter4fARB;
extern  PFNGLPROGRAMLOCALPARAMETER4DARBPROC		glProgramLocalParameter4dARB;
extern  PFNGLPROGRAMLOCALPARAMETER4FVARBPROC	glProgramLocalParameter4fvARB;
extern  PFNGLPROGRAMLOCALPARAMETER4DVARBPROC	glProgramLocalParameter4dvARB;
extern  PFNGLGETPROGRAMENVPARAMETERFVARBPROC	glGetProgramEnvParameterfvARB;
extern  PFNGLGETPROGRAMENVPARAMETERDVARBPROC	glGetProgramEnvParameterdvARB;
extern  PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC	glGetProgramLocalParameterfvARB;
extern  PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC	glGetProgramLocalParameterdvARB;
extern  PFNGLGETPROGRAMIVARBPROC				glGetProgramivARB;
extern  PFNGLGETPROGRAMSTRINGARBPROC			glGetProgramStringARB;
extern  PFNGLGETVERTEXATTRIBDVARBPROC			glGetVertexAttribdvARB;
extern  PFNGLGETVERTEXATTRIBFVARBPROC			glGetVertexAttribfvARB;
extern  PFNGLGETVERTEXATTRIBIVARBPROC			glGetVertexAttribivARB;
extern  PFNGLGETVERTEXATTRIBPOINTERVARBPROC		glGetVertexAttribPointervARB;
extern  PFNGLISPROGRAMARBPROC					glIsProgramARB;
#endif

extern  int rt_ARB_fragment_program;
#if defined(GL_ARB_fragment_program) && !defined(GL_GLEXT_PROTOTYPES) && !defined(FORCE_ARB3_PROTOTYPES)
#endif

void InitAllGL(void);

#endif
